package com.ssy.lingxi.pay.service;


import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.pay.model.vo.request.*;
import com.ssy.lingxi.pay.model.vo.response.*;

import java.util.List;

/**
 * 授信申请业务层
 * @author 伍将
 * @date 2020/8/15 10:00
 * @version 2.0.0
 */
public interface ICreditApplyService {

    /**
     * 分页查询授信申请下当前授信申请
     * @author 伍将
     * @date 2020/8/19
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditHistoryApplyVO>>
     **/
    Wrapper<PageData<CreditApplyPageQueryVO>> pageApplyByLower(UserLoginCacheDTO user, PageQueryCreditApplyVO pageVO);

    /**
     * 分页查询授信申请下当前待提交授信申请
     * @author 伍将
     * @date 2020/8/20
     * @param user:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditApplyPageQueryVO>>
     **/
    Wrapper<PageData<CreditApplyPageQueryVO>> pageWaitSubmitApplyByLower(UserLoginCacheDTO user, PageQueryCreditApplyVO pageVO);

    /**
     * 新增授信申请
     * @author 伍将
     * @date 2020/8/17 19:50
     * @param addVO:
     * @return com.ssy.lingxi.common.response.Wrapper<java.lang.Long>
     **/
    Wrapper<Long> add(UserLoginCacheDTO user, CreditApplyAddVO addVO);

    /**
     * 授信调额
     * @author 伍将
     * @date 调额
     * @param user:
     * @param adjustQuotaVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Long> adjustQuota(UserLoginCacheDTO user, CreditAdjustQuotaVO adjustQuotaVO);

    /**
     * 提交授信申请
     * @author 伍将
     * @date 2020/8/19
     * @param submitVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> submit(UserLoginCacheDTO user, CreditApplySubmitVO submitVO);

    /**
     * 提交审核申请
     * @author 伍将
     * @date 2020/8/19
     * @param submitVerifyVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> submitVerify(UserLoginCacheDTO user, CreditApplyVerifyVO submitVerifyVO);


    /**
     * 确认审核申请
     * @author 伍将
     * @date 2020/8/20
     * @param user:
     * @param submitVerifyVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> confirmVerify(UserLoginCacheDTO user, CreditApplyVerifyVO submitVerifyVO);

    /**
     * 删除申请
     * @author 伍将
     * @date 2020/8/20
     * @param user:
     * @param vo:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> delete(UserLoginCacheDTO user, CreditApplySubmitVO vo);


    /**
     * 获取授信详情
     * @author 伍将
     * @date 2020/10/27
     * @param user:
     * @param getDetailVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.pay.model.vo.response.CreditApplyDetailVO>
     **/
    Wrapper<CreditApplyDetailVO> getDetail(UserLoginCacheDTO user, CreditApplyGetDetailVO getDetailVO, Boolean isUpperSle);


    /**
     * 获取历史授信申请
     * @author 伍将
     * @date 2020/8/21
     * @param creditId: 授信id
     * @param isUpperSle ：是否上级查询
     * @return com.ssy.lingxi.common.response.Wrapper<java.util.List < com.ssy.lingxi.pay.model.vo.response.CreditHistoryApplyVO>>
     **/
    Wrapper<List<CreditHistoryApplyVO>> getHistoryList(Long creditId, Boolean isUpperSle);

    /**
     * 分页查询子会员授信申请
     * @author 伍将
     * @date 2020/8/26
     * @param user:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditApplyPageQueryVO>>
     **/
    Wrapper<PageData<CreditChildApplyPageQueryVO>> pageChildApply(UserLoginCacheDTO user, PageQueryLowerCreditApplyVO pageVO);

    /**
     * 分页查询子会员待提交授信申请
     * @author 伍将
     * @date 2020/8/26
     * @param user:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditApplyPageQueryVO>>
     **/
    Wrapper<PageData<CreditChildApplyPageQueryVO>> pageChildWaitSubmitApply(UserLoginCacheDTO user, PageQueryCreditChildApplyVO pageVO);

    /**
     * 分页查询子会员待审核第一步申请
     * @author 伍将
     * @date 2020/8/26
     * @param user:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditChildApplyPageQueryVO>>
     **/
    Wrapper<PageData<CreditChildApplyPageQueryVO>> pageChildWaitVerifyApplyStepOne(UserLoginCacheDTO user, PageQueryCreditChildApplyVO pageVO);

    /**
     * 一级审核
     * @author 伍将
     * @date 2020/10/17
     * @param user:
     * @param submitVerifyVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> verifyStepOne(UserLoginCacheDTO user, CreditApplyVerifyVO submitVerifyVO);

    /**
     * 分页查询子会员待审核第二步申请
     * @author 伍将
     * @date 2020/8/26
     * @param user:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditChildApplyPageQueryVO>>
     **/
    Wrapper<PageData<CreditChildApplyPageQueryVO>> pageChildWaitVerifyApplyStepTwo(UserLoginCacheDTO user, PageQueryCreditChildApplyVO pageVO);

    /**
     * 二级审核
     * @author 伍将
     * @date 2020/10/17
     * @param user:
     * @param submitVerifyVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> verifyStepTwo(UserLoginCacheDTO user, CreditApplyVerifyVO submitVerifyVO);

    /**
     * 分页查询子会员待审核第三步申请
     * @author 伍将
     * @date 2020/8/26
     * @param user:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditChildApplyPageQueryVO>>
     **/
    Wrapper<PageData<CreditChildApplyPageQueryVO>> pageChildWaitVerifyApplyStepThree(UserLoginCacheDTO user, PageQueryCreditChildApplyVO pageVO);

    /**
     * 二级审核
     * @author 伍将
     * @date 2020/10/17
     * @param user:
     * @param submitVerifyVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> verifyStepThree(UserLoginCacheDTO user, CreditApplyVerifyVO submitVerifyVO);

    /**
     * 分页查询子会员待确认审核申请
     * @author 伍将
     * @date 2020/8/26
     * @param user: 当前登录会员
     * @param pageVO: 
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.pay.model.vo.response.CreditChildApplyPageQueryVO>>
     **/
    Wrapper<PageData<CreditChildApplyPageQueryVO>> pageChildWaitConfirmVerifyApply(UserLoginCacheDTO user, PageQueryCreditChildApplyVO pageVO);

    /**
     * 查询调额记录
     * @author 伍将
     * @date 2021/3/9
     * @param user: 当前登录会员
     * @param creditId: 授信id
     * @return 操作结果
     **/
    Wrapper<List<CreditAdjustQuotaRecordVO>> getAdjustQuotaList(UserLoginCacheDTO user, Long creditId);
}
